package com.feriki.msync.process.source;

import com.feriki.msync.process.Handler;
import com.feriki.msync.process.sink.SinkHandler;
import org.apache.commons.lang3.tuple.Pair;

/**
 * @author luozhida
 * @create 2024-07-04
 */
public abstract class SourceHandler extends Handler {

    private long batchSize;
    private long limit = -1;

    public SourceHandler(String sourceName,String type,long batchSize,long limit){
        super(sourceName,type);
        this.batchSize = batchSize;
        this.limit = limit;
    }

    public abstract Pair<Boolean,Long> readAndHandle(SinkHandler sinkHandler);


    public long getBatchSize() {
        return batchSize;
    }

    public long getLimit() {
        return limit;
    }

}

